<?php

// This file is part of the Carrington Mobile Theme for WordPress
// http://carringtontheme.com
//
// Copyright (c) 2008-2009 Crowd Favorite, Ltd. All rights reserved.
// http://crowdfavorite.com
//
// Released under the GPL license
// http://www.opensource.org/licenses/gpl-license.php
//
// **********************************************************************
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
// **********************************************************************

if (__FILE__ == $_SERVER['SCRIPT_FILENAME']) { die(); }
if (CFCT_DEBUG) { cfct_banner(__FILE__); }

?>
<hr />
<?php
$cat=get_query_var('cat');
$p=get_query_var('p');
if(!$cat){
echo '<div><ul class="disclosure table group">';
$args=array(
  'orderby' => 'name',
  'order' => 'ASC',
   'child_of = 1'
  );
		$categories=  get_categories($args); 
  foreach ($categories as $category) {
  	  if($category->parent == 3){
$url_image = cfct_get_category_image($category->cat_ID);

		$url_image=explode('@',$url_image[0]->url);
		$url_image=$url_image[0];
  	  	   $view.='<div class="cbox w80 fl">
 			<a href="' . get_category_link( $category->term_id ) . '"><img alt="'.$category->name.'" src="'.$url_image.'" width="40px" height="31px"/><p>'.$category->name.'</p></a> </div>';
  	  	  
  	  }
  }
  echo $view;
  echo '<div style="clear:both"></div></ul>	</div>';
}
		?>
<hr />

<div class="group">
	<form id="search" action="<?php bloginfo('home'); ?>" method="get">
		<div>
			<input type="text" name="s" id="s" inputmode="predictOn" value="" />
			<input type="submit" name="submit_button" value="Tìm kiếm" />
		</div>
	</form>
</div>
